﻿using System.Diagnostics;
using System.Activities;

namespace Foulds.Calculator.StateMachine.Diagnostics
{
    /// <summary>
    /// Write simple trace output that can be used for diagnostics.
    /// </summary>
    public sealed class TraceActivity : CodeActivity
    {
        #region Text
        /// <summary>
        /// The text that should be send to to the trace.
        /// </summary>
        public InArgument<string> Text { get; set; } 
        #endregion

        #region Execute
        /// <summary>
        /// Write the text provided to the trace.
        /// </summary>
        protected override void Execute(CodeActivityContext context)
        {
            Trace.WriteLine(string.Concat("[Calculator Sate Machine] ", context.GetValue(this.Text)));
        } 
        #endregion
    }
}
